package com.novax.ex.activity.open.api.inner;

import com.novax.ex.activity.open.model.request.OperationV2RuleRequest;
import com.novax.ex.activity.open.model.response.OperationV2RuleResponse;
import com.novax.ex.common.results.ReturnResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import jakarta.validation.Valid;
import java.util.List;

/**
 * @Description 后台-活动落地页 活动标题与规则配置v2
 * @Author ChenXi
 * @Date 2023/04/18/10:48
 */
@Tag(name = " 后台-活动落地页 活动标题与规则配置v2", description = " 后台-活动落地页 活动标题与规则配置v2")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "OperationV2RuleApi", contextId = "OperationV2RuleApi")
public interface OperationV2RuleApi {

    @Operation(summary = "查询")
    @GetMapping("/v3/private/operation-v2/rule/list")
    ReturnResult<List<OperationV2RuleResponse>> list(Long operationId);

    @Operation(summary = "新增")
    @PostMapping("/v3/private/operation-v2/rule/add")
    ReturnResult<?> add(@RequestHeader("languages") String languages,
                        @Valid @RequestBody OperationV2RuleRequest operationV2RuleRequest,
                        BindingResult bindingResult);

    @Operation(summary = "修改")
    @PostMapping("/v3/private/operation-v2/rule/modify/{id}")
    ReturnResult<?> modify(@RequestHeader("languages") String languages,
                           @PathVariable Long id,
                           @Valid @RequestBody OperationV2RuleRequest operationV2RuleRequest,
                           BindingResult bindingResult);

}
